//管理token的获取、保存和删除

import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token' //设置一个独一无二的key名

const TimeStemp = 'token-stemp' //给时间戳设置一个Key名

//获取token
export function getToken () {
  return Cookies.get(TokenKey)
}

//存储Token
export function setToken (value) {
  Cookies.set(TokenKey, value)
}

//删除Token
export function removeToken () {
  Cookies.remove(TokenKey)
}

//获取时间戳
export function getTimeStemp () {
  return Cookies.get(TimeStemp)
}

//保存时间戳
export function setTimeStemp () {
  Cookies.set(TimeStemp, Date.now())
}
